#pragma once

#include <cstdint>
#include <memory>
#include <string>
#include <vector>
#include "tiny_gltf.h"

namespace kanon
{
    struct Mesh
    {
        uint32_t vao;
        uint32_t vbo;
        uint32_t vbo_normal;
        uint32_t vbo_texture;
        uint32_t ibo;
        uint32_t num_indices;

    public:
        Mesh();
        ~Mesh();

        void Bind() const;
        bool setupBuffers(const tinygltf::Model& model, int meshIndex);
        void Draw() const;
    };

    struct Model
    {
        std::vector<std::shared_ptr<Mesh> > meshes;

        bool fromGltf(const std::string& gltf_path);
    };
}